from functools import lru_cache

import aioredis
from aioredis import Redis
from fastapi import Depends, Request


@lru_cache()
def get_redis() -> Redis:
    redis = aioredis.from_url(
        # settings.cache_redis_url, encoding='utf-8', decode_responses=True
        url="redis://101.89.211.203",
        port=6379,
        password='xwch330215',
        db=0,
        encoding="utf-8",
        decode_responses=True,
    )
    return redis
